package cn.itcast.service.system.impl;

import cn.itcast.dao.system.SysLogDao;
import cn.itcast.domain.system.SysLog;
import cn.itcast.service.system.SysLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class SysLogServiceImpl implements SysLogService {

	@Autowired
	private SysLogDao sysLogDao;

	@Override
	public PageInfo findAll(String compayId, int page, int size) {
		PageHelper.startPage(page,size);
		List<SysLog> list = sysLogDao.findAll(compayId);
		return new PageInfo(list);
	}

	@Override
	public void save(SysLog log) {
		log.setId(UUID.randomUUID().toString());
		sysLogDao.save(log);
	}
}
